<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="../style/ucs.css">
		<link rel="stylesheet" href="../content/font/iconfont.css">
		<link rel="stylesheet" href="../style/theme.css">
	</head>
	<body>
	<div id="giraffe"></div>
	<script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
	<script type="text/javascript" src="../../dist/libs/engine.js"></script>
	<script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>
	<script>
		/**
		 * 个人信息：
		 * 		realNameDM:企业名称
		 * 		phoneNumDM：手机
		 * 		ownPwdDM：登录密码
		 * 	*/
		var realNameDM = new UDM({
			value: '张三'
		});
		var phoneNumDM = new UDM({
			value: '18718417732'
		});
		var ownPwdDM = new UDM({
			value:""
		});
		//个人实名信息
		var realNameInfoDM = new UDM({
			value:{
                IsNew:0, //是否有新消息
                AccType:1,
                Mobile:"155****2132",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"FinanceAccountInfo",  //当前选中菜单
                InvestAccountUrl:"../MyAccount/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
			}
		})

		var loginPwdDM = new UDM({
			label: '原密码：',
			placeholder:'请输入原密码',
			validator:[
				{type:"require",msg:"密码不能为空"},
				{
					type:"fn",
					fn:function(v){
						if(v == 123){
							return true;
						}else{
							return false;
						}
					},
					msg:"密码必须为6-16位字母、数字的组合"
				}
			]
		});
		var newPwdDM = new UDM({
			label: '新密码：',
			placeholder:'请输入新密码',
			validator:[
				{type:"require",msg:"密码不能为空"},
				{
					type:"fn",
					fn:function(v){
						if(v == 123){
							return true;
						}else{
							return false;
						}
					},
					msg:"请输入正确的密码"
				}
			]
		});
		var newPwdDM2 = new UDM({
			label: '确认新密码：',
			placeholder:'请输入新密码',
			validator:[
				{type:"require",msg:"密码不能为空"},
				{
					type:"fn",
					fn:function(v){
//						console.log(pswDM.getValue());
						if(v == newPwdDM.getValue()){
							return true;
						}else{
							return false;
						}
					},
					msg:"两次输入密码不一致"
				}
			]
		});
		var phoneCodeDM = new UDM({
			label: '手机验证码：',
			placeholder:'请输入短信验证码',
			validator:[
				{type:"require",msg:"请输入短信验证码"},
				{
					type:"fn",
					fn:function(v){
						if(v == 123){
							return true;
						}else{
							return false;
						}
					},
					msg:"短信验证码错误，请重新输入"
				},
				{
					type:"fn",
					fn:function(v){
						if(v == 123){
							return true;
						}else{
							return false;
						}
					},
					msg:"验证码已过期，请重新获取"
				}
			]
		});

		var getBtnCode = new UDM({//修改登录密码  获取短信验证码按钮
			id:"msgbtn",
			name:"",
			count:5,
			onClick:function(){
				if(loginPwdDM.validate() && newPwdDM.validate() && newPwdDM2.validate()){
					UEventHub.emit('getcode',getBtnCode);
				}else{
					console.log("校验不通过");
				}
			}
		});

        //修改登录密码弹窗
        var changeLoginLayerDM = new Dialog({
            confirmBack:function () {
                changeLoginLayerDM.setDisabled(true);//设置按钮是否禁用
                if(loginPwdDM.validate() && newPwdDM.validate() && newPwdDM2.validate() && phoneCodeDM.validate()){ //校验各数据模型
                    console.log('校验通过！')
                }else{
                    console.log('校验没通过！');
                }
//                changeLoginLayerDM.hideDialog();
				UDialog.alert({title:'dddd',content:'ddddd'});
            },
            cancelBack:function () {
                changeLoginLayerDM.hideDialog();
            },
            closeBack:function () {
                changeLoginLayerDM.hideDialog();
            }

        })

        var URLDM = new UDM({
		    financeLogin:''
		})

		var PageDM = {
			realName: realNameDM,
			phoneNum: phoneNumDM,
			loginPwd: loginPwdDM,
			newPwd: newPwdDM,
			newPwd2: newPwdDM2,
			phoneCode: phoneCodeDM,
			getBtnCode:getBtnCode,
			ownPwd:ownPwdDM,
			realNameInfo: realNameInfoDM,
            changeLoginLayer: changeLoginLayerDM,
			URL:URLDM
		}

		var ajaxFn = function(){
			/*个人实名信息*/
			var realName = {
                AccType:1,
                Mobile:"155****2132",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"FinanceAccountInfo",  //当前选中菜单
                InvestAccountUrl:"../MyAccount/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
			};
//			realNameInfoDM.setValue(realName);
		};
		UEventHub.on("pageLoad",function(){
			ajaxFn()
		});
	</script>
    <script type="text/javascript" src="../AccountInfo\index.js"></script></body>
</html>
